package com.member.shop.service;

import com.alipay.api.AlipayApiException;
import javax.servlet.http.HttpServletRequest;

/**
 * @Description 支付宝服务接口
 * @ClassName IAlipayService
 * @Date 2025/2/24 
 * @author luo.yun
 */
public interface IAlipayService {
    /**
     * @Description: 创建支付宝订单
     * @param orderNo: 订单编号
     * @param amount: 实际支付金额
     * @param body: 订单描述
     * @Date: 2019/8/1
     * @return String
     */
    String createOrder(Long tenantId, String orderNo, double amount, String body) throws AlipayApiException;

    /**
     * @Description: 创建回调地址支付宝订单
     * @param orderNo: 订单编号
     * @param amount: 实际支付金额
     * @param body: 订单描述
     * @param url:  回调地址
     * @Date: 2019/8/1
     * @return String
     */
    String createOrderByNotifyUrl(Long tenantId, String orderNo, double amount, String body,String url) throws AlipayApiException;

    /**
     * @Description:
     * @param tradeStatus: 支付宝交易状态
     * @param orderNo: 订单编号
     * @param tradeNo: 支付宝订单号
     * @Date: 2019/8/1
     * @return boolean
     */
    boolean notify(String tradeStatus, String orderNo, String tradeNo);

    /**
     * @Description: 校验签名
     * @param request
     * @Date: 2019/8/1
     * @return boolean
     */
    boolean rsaCheckV1(HttpServletRequest request);

    /**
     * @Description:
     * @param tradeStatus: 支付宝交易状态
     * @param orderNo: 订单编号
     * @param tradeNo: 支付宝订单号
     * @Date: 2019/8/1
     * @return boolean
     */
    boolean notifyBySurplus(String tradeStatus, String orderNo, String tradeNo);

    /**
     * @Description: 退款
     * @param orderNo: 订单编号
     * @param amount: 实际支付金额
     * @param refundReason: 退款原因
     * @param tradeNo tradeNo
     * @Date: 2019/8/6
     * @return String
     */
    String refund(Long tenantId, String orderNo, double amount, String refundReason,String tradeNo);
}
